from  subjects import models
from rest_framework import serializers


class CateSerializer(serializers.ModelSerializer):
  class Meta:
    model = models.CateModels
    # fields = '__all__'
    fields = ["id","name"]


class CateUpdateSerializer(serializers.ModelSerializer):
  # cate=CateSerializer(many=True)
  class Meta:
    model = models.Cateupdate
    # fields = '__all__'
    fields =["id","name","cate"]

#另一个
class CateSer(serializers.ModelSerializer):
  class Meta:
    model = models.CateModels2
    # fields = '__all__'
    fields = ["id","name"]


class CateUpdateSer(serializers.ModelSerializer):
  # cate=CateSerializer(many=True)
  class Meta:
    model = models.Cateupdate2
    # fields = '__all__'
    fields =["id","name","cate"]